/**
 * @author SHIXINGXING
 */

/*添加股票*/
function add(){
    window.self.location="stock.do?method=addStock";
}
/*删除股票*/
function del(){
    var flag = false;
    for (var i = 0; i < document.getElementsByName("ids").length; i++) {
        if (document.getElementsByName("ids")[i].checked) {
            flag = true;
        }
    }
    if (!flag) {
        alert("请选择需要删除的股票！");
        return;
    }
    if (window.confirm("确认删除吗？")) {
    
        with (document.getElementById("list")) {
        
            method = "post";
            action = "stock.do?method=delStock";
            submit();
        }
    }
}
/*选择股票，单选框*/
function selectAll(){
    if (list.checkbox.checked == true) {
        for (var i = 0; i < list.ids.length; i++) 
            list.ids[i].checked = true;
        if (list.ids.length == null) 
            list.ids.checked = true;
    }
    else {
        for (var i = 0; i < list.ids.length; i++) 
            list.ids[i].checked = false;
        if (list.ids.length == null) 
            list.ids.checked = false;
    }
}
/*编辑股票*/
function edit(){
    alert("股票无法编辑,如果录错请删除掉重新录入！");
}